package com.dq.domain.statistics;

import com.dq.domain.base.BaseEntity;
import com.dq.domain.sys.user.user.BossUser;
import com.dq.vo.baseVo.VO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.Entity;
import javax.persistence.ManyToOne;

/**
 * @Author luchangtong
 * @Date 2020/4/17 15:20
 */
@Data
@Entity
@ApiModel("员工预约数统计")
public class SubscribeStatistics  extends BaseEntity implements VO.ToVO {
    public Long subscribeNum;
    @ApiModelProperty("员工")
    @ManyToOne
    protected BossUser staffUser;

    public static class Vo implements VO {
        public Long subscribeNum;
        public Long staffUserId;
        public String staffUserRealcName;
    }
    @Override
    public VO toVO(boolean isRecursion) {
        Vo vo =new Vo();
        vo.subscribeNum = this.getSubscribeNum();
        vo.staffUserId = this.getStaffUser() != null ? this.getStaffUser().getId():null;
        vo.staffUserRealcName = this.getStaffUser() != null ? this.getStaffUser().getUserRealcName():"";
        return vo;
    }
}
